<?php

$str = "11";

$preg = "/(0[1-9]|1[0-2])/";

$c = preg_match($preg,$str);


var_dump($c);

$str = '888a8';

$preg = "/\d\d\d\d\d/";

$str = "15425139194";

$preg = "/1(3\d|4[47]|5[015679]|66|7[127]|8[129])\d\d\d\d\d\d\d\d/";

$c = preg_match($preg,$str);

var_dump($c);


$str = "xxxxxxxxxxwww.xuebingsi.comxxxxxxxxxxxxxxxxx";

$preg = "/(www\.)xuebingsi(\.com)/";

// $c = preg_match($preg,$str);
$c = preg_replace($preg,"$1bai$1du$2",$str);

var_dump($c);

$num = "18925139194";

$preg = "/^1(3\d|4[47]|5[015679]|66|7[127]|8[129])\d{8}$/";

$c = preg_match($preg,$num);

var_dump($c);


$str = "aabbbbccc";

$preg="/b{2,4}?/";

$c = preg_replace($preg,'xx',$str);

var_dump($c);


$str = "456746";

$preg = "/^\d{5}$/";

$c = preg_match($preg,$str);

var_dump($c);


$name = "Ahibin8";  // 由字母 数学 下划线 组成，不能数字，下划线开头，6-8位；

$preg = "/^[a-z]\w{5,7}$/i";

$c = preg_match($preg,$name);

var_dump($c);

// ---------------------------------------------------------------

$str = "1.gif";

$preg = "/.+\.(png|jpg|gif|bmp)$/";

$c = preg_match($preg,$str);

var_dump($c);

// "^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\\d{8}$";
// 
// /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/

// /^[1][3,4,5,7,8][0-9]{9}$/

// /^1[34578]\d{9}$/
// 

// $mail = "sdfsdf@qq.com.cn7";

// $preg = "/^([a-z\d]{1,2}|[a-z\d][a-z\d-_]{1,}[a-z\d])@[a-z\d]+(\.[a-z]{2,})+$/i";

// $c = preg_match($preg,$mail);

// var_dump($c);

// _@baike.baidu.com

// zhidao.baidu.com
// a@qq.com

// ^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$
// 
// ^[a-z0-9A-Z]+[-|a-z0-9A-Z._]+@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-z]{2,}$
// 

// $str = "1.jpg@2.jpg#3.jpg@4.jpg";

// $preg = "/[@#]/";

// $c = preg_split($preg,$str);

// var_dump($c);